home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / buildCreatorMenu.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  11.9 KB  |  337 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. // Copyright (C) 1997-2001 Alias|Wavefront,
  18. // a division of Silicon Graphics Limited.
  19. //
  20. // The information in this file is provided for the exclusive use of the
  21. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  22. // and incorporate this code into other products for purposes authorized
  23. // by the Alias|Wavefront license agreement, without fee.
  24. //
  25. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  26. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  27. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  28. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  29. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  30. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  31. // PERFORMANCE OF THIS SOFTWARE.
  32. //
  33. //  Alias|Wavefront Script File
  34. //  MODIFY THIS AT YOUR OWN RISK
  35. //
  36. //  Creation Date:  16 Feb 1999
  37. //
  38. //
  39. //
  40. //  Description:
  41. //      This implements the "Display" menu on the main menubar.
  42. //
  43.  
  44.  
  45. // Helper procs. these are approxomately in the same order the items are in the Display menu
  46.  
  47. // global proc gridMenuUpdate() {
  48. // //
  49. // // This is called when a "gridDisplayChanged" event is detected.
  50. // // Update the menu item, the option var and the gShowGrid variable.
  51. // //
  52. //     if( `menuItem -exists dispGridItem` ) {
  53. //         menuItem -e -cb `grid -q -tgl` dispGridItem;
  54. //     }
  55. // }
  56.  
  57. // global proc viewAxesMenuUpdate() {
  58. // //
  59. // // This is called when a "viewAxesDisplayChanged" event is detected.
  60. // // Update the menu item, the option var and the gToggleViewAxis variable.
  61. // //
  62. //     if( `menuItem -exists viewAxesItem` ) {
  63. //         menuItem -e -cb `toggleAxis -q -v` viewAxesItem;
  64. //     }
  65. // }
  66.  
  67. // global proc originAxesMenuUpdate() {
  68. // //
  69. // // This is called when a "originAxesDisplayChanged" event is detected.
  70. // // Update the menu item, the option var and the gToggleOriginAxis variable.
  71. // //
  72. //     if( `menuItem -exists originAxesItem` ) {
  73. //         menuItem -e -cb `toggleAxis -q -o` originAxesItem;
  74. //     }
  75. // }
  76.  
  77. // Moved to brushToolSettings.mel
  78. //global proc brushToolSettings(){
  79. //    if ( !`window -exists PaintEffectsBrushWindow` ){
  80. //
  81. //        window
  82. //            -t "Paint Effects Brush Settings"
  83. //            -width 510 -height 600
  84. //            PaintEffectsBrushWindow;
  85. //
  86. //        // string $lName = `frameLayout -bv 0 -cl 0 -cll 0 -lv 0`;
  87. //        string $cmd = "getDefaultBrush( )";
  88. //        string $defName = `eval $cmd`;
  89. //
  90. //        string $lName = `paneLayout`;
  91. //
  92. //        createEditor $lName $defName;
  93. //
  94. //        setParent ..;
  95. //        frameLayout;
  96. //        nameField -ncc ("brushNameCallback " + $lName) -o $defName;
  97. //    }
  98. //
  99. //    showWindow PaintEffectsBrushWindow;
  100. //}
  101.  
  102. global proc creatorGlobalSettings(){
  103.  
  104.     if ( !`window -exists CreatorGlobalsWindow` ){
  105.  
  106.         window -t "Paint Effects Globals"
  107.             -in "Paint Effects Globals"
  108.             -width 510 -height 600
  109.             CreatorGlobalsWindow;
  110.  
  111.         string $lName = `frameLayout -bv 0 -cl 0 -cll 0 -lv 0`;
  112.  
  113.         createEditor $lName "strokeGlobals";
  114.     }
  115.  
  116.     showWindow CreatorGlobalsWindow;
  117. }
  118.  
  119. global proc checkPresetBlend()
  120. {
  121.     global string $presetBlendMenu;
  122.     global int $gPresetBlending;
  123.  
  124.     if(`menuItem -q -cb presetBlendMenu`)
  125.     {
  126.         $gPresetBlending = 1;
  127.     }
  128.     else
  129.     {
  130.         $gPresetBlending = 0;
  131.         if (`window -ex brushPresetBlendWnd`)
  132.         {
  133.             deleteUI -window brushPresetBlendWnd;
  134.         }
  135.         
  136.     }
  137. }
  138.  
  139. global proc changeTubeDirection()
  140. {
  141.     int $attr;
  142.     string $brush;
  143.  
  144.     $brush = getDefaultBrush();
  145.     $attr = `getAttr($brush + ".tubeDirection")`;
  146.     $attr = !$attr;
  147.     setAttr ($brush + ".tubeDirection") $attr;
  148. }
  149.  
  150. global proc buildCreatorMenu ( string $parent ) {
  151. //
  152. //    Build the Creator menu.  Checks to see if it's already
  153. //    been built, and returns if this is true.
  154. //
  155.     global string $gCreatorWireCtx;
  156.     setParent -m $parent;
  157.  
  158.     global int $gPresetBlending;
  159.     global string $presetBlendMenu;
  160.     string $flipTubeDirMenu;
  161.  
  162.     int $doProject = 0;
  163.     
  164.     if ( `licenseCheck -m "edit" -typ "particlePaint"`) {
  165.      $doProject = `dynWireCtx -q -dp $gCreatorWireCtx`;
  166.     }
  167.     
  168.     string $editor = "There is no editor";
  169.  
  170.     if( `menu -q -ni $parent` == 0 ) {
  171.  
  172.         menuItem -label "Paint Effects Tool"
  173.             -annotation "Paint Effects Tool: Draw strokes on paintable surfaces or the ground plane"
  174.             -image "paintEffectsTool.xpm"
  175.             -command "PaintEffectsTool";
  176.         menuItem -optionBox true
  177.             -annotation "Paint Effects Tool Option Box"
  178.             -image "paintEffectsTool.xpm"
  179.             -command "PaintEffectsToolOptions";
  180.     
  181.         if ( `licenseCheck -m "edit" -typ "particlePaint"`) {
  182.             menuItem -label "Make Paintable"
  183.                 -annotation "Make Paintable: Make the selected surface(s) paintable, and other surfaces not paintable"
  184.                 -image "makePaintable.xpm" 
  185.                 -command ("MakePaintable");
  186.         }
  187.         
  188.         menuItem -d true;
  189.  
  190.         menuItem -label "Get Brush..."
  191.             -annotation "Get Brush: Choose a Paint Effects Brush to paint with"
  192.             -image "paintEffectsBrushesLarge.xpm"
  193.             -command ("VisorWindow");
  194.  
  195.         menuItem -label "Template Brush Settings..."
  196.             -annotation "Template Brush Settings: Edit the brush settings which will be applied to subsequent strokes"
  197.             -image "templateBrushSettings.xpm"  
  198.             -command "TemplateBrushSettings";
  199.         menuItem -label "Reset Template Brush"
  200.             -annotation "Reset Template Brush: Reset the template brush attributes to their default values"
  201.             -image "resetTemplateBrush.xpm"  
  202.             -command "ResetTemplateBrush";
  203.  
  204.         menuItem -label "Flip Tube Direction"
  205.             -annotation "Flip the Tube Direction on the Current Brush"
  206.             -image "flipTube.xpm"
  207.             -command "changeTubeDirection" flipTubeDirMenu;
  208.  
  209.         menuItem -d true;
  210.         
  211.         if ( `licenseCheck -m "edit" -typ "particlePaint"`) {
  212.             radioMenuItemCollection;
  213.             menuItem -label "Paint on Paintable Objects"
  214.                 -radioButton ( $doProject )
  215.                 -annotation ("Paint on Paintable Objects: When on, project " +
  216.                              "strokes onto the paintable objects in the scene")
  217.                 -command ("PaintOnPaintableObjects");
  218.             menuItem -label "Paint on View Plane"
  219.                 -radioButton ( !$doProject)
  220.                 -annotation ("Paint on View Plane: When on, project strokes onto the view"+
  221.                      " plane (Like a piece of glass in front of the camera)")
  222.                 -command ("PaintOnViewPlane");
  223.  
  224.             menuItem -d true;
  225.             menuItem -label "Apply Settings to Last Stroke"
  226.                 -annotation ("Apply Settings to Last Stroke: Copy the current template brush settings "+
  227.                         "onto the most recently created stroke")
  228.                 -command "ApplySettingsToLastStroke";
  229.             menuItem -label "Get Settings from Selected Stroke"
  230.                 -annotation "Get Settings from Selected Stroke: Copy the brush settings from the currently selected stroke to the template brush"
  231.                 -command "GetSettingsFromSelectedStroke";
  232.             menuItem -label "Apply Settings to Selected Strokes"
  233.                 -annotation "Apply Settings to Selected Strokes: Copy the template brush settings to the currently selected strokes"
  234.                 -command "ApplySettingsToSelectedStroke";
  235.             menuItem -d true;
  236.             menuItem -label "Share One Brush"
  237.                 -annotation "Share One Brush: Cause selected strokes to share a common brush (so that editing the brush changes the appearance of all these strokes)"
  238.                 -command "ShareOneBrush";
  239.             menuItem -label "Remove Brush Sharing"
  240.                 -annotation "Remove Brush Sharing: Give each selected stroke a unique brush (if it was previously sharing a brush)"
  241.                 -command "RemoveBrushSharing";
  242.  
  243.             menuItem -label "Select Brush/Stroke Names Containing..."
  244.                 -annotation "Select Brush/Stroke Names Containing: Select brushes/strokes whose name contains the specified characters"
  245.                 -command "SelectBrushNames";
  246.  
  247.             menuItem -d true;
  248.  
  249.             menuItem -l "Brush Animation" -subMenu true -aob true;
  250.  
  251.             menuItem -label "Loop Brush Animation"
  252.                  -annotation "Loop Brush Animation: Make the selected brush's animation loop seamlessly"
  253.                  -command "LoopBrushAnimation"
  254.                  -dmc "performLoopBrushAnim 2";// -i "iconName.xpm";
  255.             menuItem -optionBox true -command "LoopBrushAnimationOptions";
  256.  
  257.             menuItem -label "Make Brush Spring" 
  258.                  -annotation "Make Brush Spring: Add an expression simulating spring dynamics to the selected stroke(s)"
  259.                  -command "MakeBrushSpring"
  260.                  -dmc "performMakeBrushSpring 2";// -i "iconName.xpm";
  261.             menuItem -optionBox true -command "MakeBrushSpringOptions";
  262.  
  263.             menuItem -label "Bake Spring Animation" 
  264.                  -annotation "Bake Spring Animation: Create animation curves for any selected stroke(s) which had \"Make Brush Spring\" applied"
  265.                  -command "BakeSpringAnimation"
  266.                   -dmc "performBakeBrushSpringAnim 2";// -i "iconName.xpm";
  267.             menuItem -optionBox true -command "BakeSpringAnimationOptions";
  268.  
  269.             setParent -m ..;
  270.  
  271.             menuItem -l "Curve Utilities" -subMenu true -aob true;
  272.             menuItem -l "Simplify Stroke Path Curves" 
  273.                 -annotation 
  274.                  "Simplify Stroke Path Curves: Reduce the number of CVs in the selected stroke(s)" 
  275.                 -c "SimplifyStrokePathCurves";
  276.  
  277.             menuItem -l "Set Stroke Control Curves" 
  278.                 -annotation 
  279.                  "Set Stroke Control Curves: Make selected curve(s) control the selected stroke(s) (see Curve Follow attribute)"
  280.                 -c "SetStrokeControlCurves";
  281.  
  282.             menuItem -label "Attach Brush to Curves"
  283.                 -annotation "Attach Brush to Curves: Create a new stroke using the selected curve(s) and the template brush"
  284.                 -command "AttachBrushToCurves";
  285.  
  286.             menuItem -label "Make Pressure Curve" 
  287.                  -annotation "Make Pressure Curve: Create a curve to adjust brushstroke pressure values"
  288.                  -command "MakePressureCurve"
  289.                  -dmc "performMakePressureCurve 2";// -i "iconName.xpm";
  290.             menuItem -optionBox true -command "MakePressureCurveOptions";
  291.  
  292.             setParent -m ..;
  293.             menuItem -l "Auto Paint" -subMenu true -aob true;
  294.             menuItem -l "Paint Grid" 
  295.                 -annotation 
  296.                  "Paint Grid: Paint current brush in grid layout on selected surface(s)" 
  297.                 -c "PaintGrid"
  298.                    -dmc "performPaintGrid 2";// -i "iconName.xpm";
  299.             menuItem -optionBox true -command "PaintGridOptions";
  300.  
  301.             menuItem -l "Paint Random" 
  302.                 -annotation 
  303.                  "Paint Random: Paint current brush in random layout on selected surface(s)" 
  304.                 -c "PaintRandom"
  305.                    -dmc "performPaintRandom 2";// -i "iconName.xpm";
  306.                menuItem -optionBox true -command "PaintRandomOptions";
  307.  
  308.             setParent -m ..;
  309.         
  310.             menuItem -d true;
  311.         }
  312.         
  313.         menuItem -label "Paint Effects Globals..."
  314.             -annotation "Paint Effects Globals: Edit global Paint Effects attributes"
  315.             -command "PaintEffectsGlobalSettings";
  316.  
  317.         menuItem -label "Paint Effects Mesh Quality..."
  318.             -annotation "Mesh Quality: Edit mesh quality attributes for selected stroke or paint effects mesh"
  319.             -command "PaintEffectsMeshQuality";
  320.  
  321.         menuItem -l "Preset Blending" -cb false
  322.             -annotation "Toggles Preset Blending"
  323.             -command "checkPresetBlend" presetBlendMenu;
  324.  
  325.         menuItem -ecr false -optionBox 1 
  326.             -annotation "Preset Blending: Set mix-in levels for brush presets"
  327.             -l "Preset Blending"
  328.             -c "PresetBlendingWindow";
  329.  
  330.  
  331.         menuItem -label "Save Brush Preset..."
  332.             -annotation "Save Brush Preset: Save the settings of the template brush to current shelf or Visor directory"
  333.             -command "SaveBrushPreset";
  334.     }
  335. }
  336.  
  337.